package com.zdy.im.user.service;

import com.sixeco.framework.common.data.BasePage;
import com.sixeco.framework.http.data.vo.ResponseResultList;
import com.sixeco.framework.util.PageUtils;
import com.zdy.im.user.dto.request.ImRoomUserShipRequestDto;
import com.zdy.im.user.dto.response.ImRoomUserShipResponseDto;

import java.util.Collection;
import java.util.List;
import java.util.Map;


import java.io.InputStream;

/**
 * @ClassName: ImRoomUserShipService.java
 * @Description: 群与用户关系的数据交互处理类
 * @Author 作者 : zdy
 * @CreateDate 创建时间: 2021-02-30
 * @version V1.0.0
 * <p>
 * ----------------------------------------------------------------------------
 *  modifyer    modifyTime                 comment
 *
 * ----------------------------------------------------------------------------
 * </p>
 */
public interface ImRoomUserShipService {



    /**
     * 保存群与用户关系更新数据库和缓存的实现方法
     * @param imRoomUserShipRequestDto  ImRoomUserShipRequestDto
     * @return
     */
    ImRoomUserShipResponseDto saveImRoomUserShip(ImRoomUserShipRequestDto imRoomUserShipRequestDto);

    /**
     * 保存群与用户关系更新数据库和缓存的实现方法
     * @return
     */
    boolean saveBatchImRoomUserShip(Collection<ImRoomUserShipRequestDto> entityList, int batchSize);

    /**
     * 保存群与用户关系更新数据库和缓存的实现方法
     * @return
     */
    boolean saveOrUpdateBatchImRoomUserShip(Collection<ImRoomUserShipRequestDto> entityList, int batchSize);



    /**
     * 更新群与用户关系同时更新数据库和缓存的实现方法
     * @param imRoomUserShipRequestDto  ImRoomUserShipRequestDto
     * @return
     */
    boolean updateImRoomUserShip (ImRoomUserShipRequestDto imRoomUserShipRequestDto);

    /**
     * 更新群与用户关系同时更新数据库和缓存的实现方法
     * @return
     */
    boolean updateBatchById(Collection<ImRoomUserShipRequestDto> entityList, int batchSize);


    /**
     * 通过主键ID删除对象信息实现缓存和数据库,同时删除的方法
     * @param  imRoomUserShipIds
     * @return
     */
    int delImRoomUserShipByIds(List<Long>  imRoomUserShipIds);


    /**
     * 通过主键ID更新对象群与用户关系实现缓存和数据库更新的方法
     * @param  imRoomUserShipId
     * @return
     */
        ImRoomUserShipResponseDto getImRoomUserShipById(long imRoomUserShipId);



    /**
     * 通过分页获取ImRoomUserShipResponseDto信息实现查找缓存和数据库的方法
     * @param page BasePage
     * @return
     */
    List<ImRoomUserShipResponseDto> getImRoomUserShipByPage(BasePage page);



    /**
     * 通过分页获取ImRoomUserShip 群与用户关系信息实现查找缓存和数据库的方法
     * @param page BasePage
     * @return
     * @author suven
     * @date 2021-05-11 15:34:25
     */
    ResponseResultList<ImRoomUserShipResponseDto> getImRoomUserShipByNextPage(BasePage page);


    public PageUtils queryPage(Map<String, Object> params);


    /**
    * 通过上传excel 保存数据到数据库
    * @param initialStream
    * @return
    */
    public boolean saveData(InputStream initialStream);

    List<ImRoomUserShipResponseDto> getImRoomUserShipByUserId(long userId);

    List<ImRoomUserShipResponseDto> selectListByUserId(long userId);

    ImRoomUserShipResponseDto selectRoomFriend(long userId,long roomId);

    List<ImRoomUserShipResponseDto> selectListByRoomId(long roomId);

    Map<Long,ImRoomUserShipResponseDto> selectMapByRoomId(long roomId);

    List<ImRoomUserShipResponseDto> selectListByRoomId(ImRoomUserShipRequestDto imRoomUser);

    List<ImRoomUserShipResponseDto> selectRoomFriend(Collection<Long> userIds,long roomId);
}